Image sensing apparatuses and, more specifically, digital still cameras (to be referred to as “digital cameras” hereinafter) which are recently becoming popular have various kinds of image processing functions including an exposure amount adjusting function called AGC (Auto Gain Control) to cause the luminance range of an object to fall within the dynamic range of an image sensing device on the basis of an image signal obtained by the image sensing device comprising a sensor such as a CCD or CMOS, a tinted image adjusting function called AWB (Auto White Balance) to correct a tinted object image to an image having an appropriate tone, a gamma conversion function to adjust the change in gray level or contrast, a noise removal function, and an edge enhancement function. There is recently an intention to put intelligence in such processing for an image sensing signal, as disclosed in, e.g., Japanese Patent Laid-Open Nos. 2000-123164 and 2000-123165.
Japanese Patent Laid-Open No. 2000-123164 describes that it is more preferable to change the degree of processing or conversion in accordance with a characteristic feature in an image than to execute predetermined processing without considering the characteristic feature in the image. Japanese Patent Laid-Open No. 2000-123165 discloses attaching weight to the main object in an image, i.e., image correction appropriate for the main object.
As is known, in reproducing an image by displaying a sensed image on a display screen or making a hard copy of an image by using a color printer, image enhancement processing or image correction processing (the manner of color reproduction or contrast adjustment for skin color) for a portrait containing a person as a main object is executed in a manner different from that for images of other types so that the reproduced image can make a good impression on an observer.
For conventional silver halide photos, when a positive picture is printed from a color negative film with an image of a person after adjusting his/her complexion to an appropriate color, generally, a good impression can be made on the observer of the photo. That is, when the print exposure amount is decided on the basis of the color of the face of a person, the image quality can be increased, as is known.
There are disclosed several methods of extracting the face of a person from a sensed image. For example, Japanese Patent Laid-Open No. 2001-309225 discloses a technique for detecting a face by using a first algorithm of face candidate detection and a second algorithm. The first algorithm uses a pattern recognition operator, in which a central portion which is supposed to contain skin at a high probability is searched for on the basis of the color and shape, and additionally, a peripheral region which is supposed to contain hair at a high probability is searched for on the basis of the color and shape, thereby searching for a region which contains a face at a high probability. In the second algorithm, the presence of the face in the face candidate region obtained by the first algorithm is confirmed by pattern matching.
Japanese Patent Laid-Open No. 08-063595 discloses a method of extracting the contour of a skin color region on the basis of the color and detecting a face by matching with a face contour template prepared in advance, a method of obtaining an eye candidate region and detecting a face by matching with an eye template, and a method of obtaining a feature factor which is defined from the two-dimensional Fourier transform result of a face candidate region obtained by a face contour template and the two-dimensional Fourier transform result of a face template image prepared in advance and containing eyes, nose, mouth, and hair, and executing threshold processing of the feature factor to detect a face.
In the method disclosed in Japanese Patent Laid-Open No. 2002-183731, an eye candidate region is obtained. If a plurality of eye candidates are detected, an annular region is defined near each arbitrary pair of eye candidates. Then, a face is detected on the basis of the direction difference between the pixel value gradient of each pixel in the region with respect to a neighboring pixel and a predetermined reference gradient.
There is also proposed a technique for detecting the face region of a person or detecting a face component such as an eye, nose, or mouth in order to generate a synthesized face image for personal authentication or amusement. In the technique disclosed in, e.g., Japanese Patent Laid-Open No. 09-251534, a face region is detected by using a standard face image (template) registered in advance. Candidates of a feature factor such as an eyeball (pupil) or naris are extracted from the extracted face region. A face component such as an eye, nose, or mouth is detected on the basis of the layout of the feature factor candidates or the similarity to a template of an eye, nose, or mouth, which is registered in advance.
In the technique described in Japanese Patent Laid-Open No. 2000-322588, a face region is determined from an input image. A face component such as an eye, nose, or mouth is detected from the determined face region, and the central coordinate position of the pupil in the eye or the central coordinate position of the naris is output. Alternatively, the position of the mouth or other face component is detected, and its position is output.
When the above-described techniques, i.e., the techniques for extracting the face of a person contained in an image are used, the position and size of the face of a person in the image and the number of faces that exist in the image can be grasped. On the other hand, only uniform image processing is generally executed for a portrait even through it is adaptive processing. Hence, no suitable output image can always be obtained for all portraits. From the viewpoint of such a situation, there is a demand for a mechanism which automatically executes image input, face information acquisition, and high quality processing based on the input data in adjusting the reproduction tone in printing a photo image depending on whether the main object is a person. In addition, finer adjustment considering the size and position of the face is demanded.